import request from '@/utils/request2'

// 发送验证码
export const reqSendCode = (phone) => {
  return request({
    method: 'GET',
    url: `/user/passport/sendCode/${phone}`,
  })
}

// 注册
export const reqRegister = ({ phone, code, password }) => {
  return request({
    method: 'POST',
    url: `/user/passport/register`,
    data: {
      phone,
      code,
      password,
    },
  })
}

// 登出
export const reqLogout = () => {
  return request({
    method: 'GET',
    url: `/user/passport/logout`,
  })
}

// 登录
export const reqLogin = (phone, password) => {
  return request({
    method: 'POST',
    url: `/user/passport/login`,
    data: {
      phone,
      password,
    },
  })
}
